package com.example.observer;

import java.util.*;

/**
 * Created by Risky57 on 2017/4/28.
 */

public class ObserverDemo {

    public static void main (String[] args) {

//        java.util.Observer


        Teacher teacher = new Teacher();
        StudentMXY mxy = new StudentMXY();
        StudentWQ wq = new StudentWQ();
        StudentCFY cfy = new StudentCFY();
        teacher.register(mxy);
        teacher.register(wq);
        teacher.register(cfy);

        teacher.notifyDataSetChanged("下课");
        teacher.notifyDataSetChanged("上课");
    }


}
